//
//  YCStrategyCell.m
//  YCSchool
//
//  Created by Kylin on 16/5/1.
//  Copyright © 2016年 yanglinxia. All rights reserved.
// 自定义考试攻略的ColectionViewCell  考规介绍/考前必读 等....


#import "YCStrategyCell.h"

@interface YCStrategyCell ()

/**imageView*/
@property(nonatomic,weak)UIImageView *imageView;
/**标题*/
@property(nonatomic,weak)UILabel *Celltitle;

@end

// 赋值
@implementation YCStrategyCell
- (void)setTitle:(NSString *)title{
    _title = title;
    _Celltitle.text = title;
}

- (void)setImage:(NSString *)image{
    _image = image;
    _imageView.image = [UIImage imageNamed:image];
   
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
    
        [self setupChildView];
    }
    
    return self;
}

- (void)setupChildView{
    UIImageView *imageView = [[UIImageView alloc]init];
    [self.contentView addSubview:imageView];
    _imageView = imageView;
    imageView.contentMode = UIViewContentModeScaleAspectFill;

    
    UILabel *Celltitle = [[UILabel alloc]init];
    Celltitle.textColor = [UIColor yc_colorWithUInt:0x808080];
    Celltitle.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:Celltitle];

    _Celltitle = Celltitle;
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(29);
        make.top.equalTo(self.contentView).offset(15);
        make.width.equalTo(@36);
        make.height.equalTo(@36);

    }];
    
    [Celltitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageView.mas_bottom).offset(8);
        make.height.equalTo(@12);
        make.centerX.equalTo(imageView);
    }];
    
}



@end
